package com.graduate.examapp.model

import com.graduate.examapp.entity.ExamRangeParam
import com.graduate.examapp.entity.ExamTask
import com.graduate.examapp.request.Response
import com.graduate.examapp.request.RetrofitRequest

class ExamTaskRepository {
    private val service = RetrofitRequest.getService()

    suspend fun fetchAssistExamTask(assistantId: String): Response<List<ExamTask>> {
        return service.fetchAssitTask(assistantId)
    }

    suspend fun fetchInvigilateExamTask(invigilatorId: String): Response<List<ExamTask>> {
        return service.fetchInvigilateTask(invigilatorId)
    }

    suspend fun rangeExam(examRangeParam: ExamRangeParam): Response<ExamTask> {
        return service.rangeExam(examRangeParam)
    }

    suspend fun fetchAllExamTask(insName: String): Response<MutableList<ExamTask>> {
        return service.fetchAllExam(insName)
    }

    suspend fun delExamTask(id: Int): Response<Boolean> {
        return service.cancelExam(id)
    }

    suspend fun setFirstDay(firstDay: String): Response<Boolean> {
        return service.setFrstDay(firstDay)
    }

    suspend fun logout(): Response<Boolean> {
        return service.logout()
    }
}